﻿create procedure PR_GetEventContability (@Date datetime)
as 
begin 
select * from GL gl
inner join Sector s on
gl.SectorId = s.Id
inner join GocAttributes..goc g on
g.LocalCostCode = s.Code
inner join [GocAttributes].[dbo].[Rule] r on 
g.RuleId = r.Id 
where r.Name in (select trr.Value from 
GocAttributes..TypeRuleResult trr where Type = 0 ) AND gl.Date >= @Date
end